package cn.wolfcode.p2p.base.qo;

import cn.wolfcode.p2p.base.util.Constants;
import cn.wolfcode.p2p.base.util.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter@Setter
public class BidRequestQueryObject extends QueryObject {
    private Integer bidRequestState = -1;
    private int[] states;
    private String orderByCondition;
    private int bidRequestType = Constants.BIDREQUEST_TYPE_NORMAL;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;

    public Date getEndDate(){
        return endDate == null ? null: DateUtil.getEndDate(endDate);
    }
}
